package com.service.impl;

import com.bean.Retreat;
import com.dao.RetreatMapper;
import com.service.RetreateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
@Service("Retreat")
public class RetreateServiceImpl implements RetreateService {

    @Autowired
    private RetreatMapper retreatMapper;
    @Override
    public int save(Retreat retreat) {
        return retreatMapper.insert(retreat);
    }

    @Override
    public int remove(Retreat retreat) {
        return retreatMapper.delete(retreat);
    }

    @Override
    public int modify(Retreat retreat) {
        return retreatMapper.update(retreat);
    }

    @Override
    public List<Retreat> find(Retreat retreat) {
        return retreatMapper.select(retreat);
    }

    @Override
    public int count(Map<String, Object> map) {
        return retreatMapper.selectCount(map);
    }

    @Override
    public List<Retreat> query(Map<String, Object> map) {
        return retreatMapper.selectByPage(map);
    }
}
